snippet a
	CC=${1:gcc}
	CFLAGS=-Wall -g

	OBJPATH=obj                # .d文件和.o文件保存路径
	TARGET=${2:name}                # 最终可执行文件

	default: $(TARGET)

	SOURCE=${3:a.c b.c}                # 需要编译的.c文件
	INCLUDE=${4}

	# 获取.d文件名集合
	DEPS=$(addprefix $(OBJPATH)/, $(patsubst %.c, %.d, $(filter %.c, $(SOURCE))))
	# 获取.o文件名集合
	OBJS=$(addprefix $(OBJPATH)/, $(addsuffix .o, $(basename $(SOURCE))))

	-include $(DEPS)

	# 生成.d文件
	$(OBJPATH)/%.d: %.c
		$(CC) $(INCLUDE) -MM $< | sed "1s|^|$(dir $@)|" |"
		sed "1{x;s|.*|$@: $<|;G;}" > $(basename $@).d

	# 生成.o文件
	$(OBJPATH)/%.o : %.c
		$(CC) $(CFLAGS) -o $@ -c $<

	# 链接成可执行文件
	$(TARGET): $(OBJS)
		$(CC) $(CFLAGS) -o $@ $^

	# 清理
	clean:
		rm -rf $(OBJPATH)/*.d $(OBJPATH)/*.o $(TARGET) 
	${5:# any next?}
